// app.ts
App<IAppOption>({
  globalData: {
    islogin:false,
    voteuser:{},
    capsuleObj:{},//启动小程序设备的相关参数
    titleHeight:{}//自定义头部组件的动态高度
  },
  onLaunch() {
       // 获取自定义顶部高度相关参数
       let capsuleObj = wx.getMenuButtonBoundingClientRect();
       wx.getSystemInfo({
         success: (res) => {
           var statusBarHeight = res.statusBarHeight; //顶部状态栏高度
           this.globalData.capsuleObj = capsuleObj;
           this.globalData.titleHeight = statusBarHeight + capsuleObj.height + (capsuleObj.top - statusBarHeight) * 2;
           console.log(this.globalData.capsuleObj)
           console.log("自定组件高度"+this.globalData.titleHeight)
         },
         failure() {
         }
       })
  },
})